import request from '@/config/axios'

// 平台收款账户 VO
export interface SystemBankVO {
  id: number // 主键ID
  accountName: string // 账户名称
  accountNumber: string // 账号
  bankName: string // 银行名称
  branchName: string // 支行名称
  isActive: number // 是否激活
  status: number // 状态
}

// 平台收款账户 API
export const SystemBankApi = {
  // 查询平台收款账户分页
  getSystemBankPage: async (params: any) => {
    return await request.get({ url: `/juliang/system-bank/page`, params })
  },

  // 查询平台收款账户详情
  getSystemBankById: async (id: number) => {
    return await request.get({ url: `/juliang/system-bank/getById?id=` + id })
  },

  // 新增平台收款账户
  createSystemBank: async (data: SystemBankVO) => {
    return await request.post({ url: `/juliang/system-bank/create`, data })
  },

  // 修改平台收款账户
  updateSystemBank: async (data: SystemBankVO) => {
    return await request.post({ url: `/juliang/system-bank/update`, data })
  },

  // 修改平台收款账户状态
  updateSystemBankStatus: async (id: number, status: number) => {
    const data = {
      id,
      status
    }
    return await request.post({ url: `/juliang/system-bank/updateStatus`, data: data })
  },

  // 删除平台收款账户
  deleteSystemBankById: async (id: number) => {
    return await request.get({ url: `/juliang/system-bank/delete?id=` + id })
  },

  // 导出平台收款账户 Excel
  exportSystemBank: async (params) => {
    return await request.download({ url: `/juliang/system-bank/export-excel`, params })
  },
}
